Skip to content

Bump protosearch to latest snapshot - #672

Merged
valencik merged 3 commits into
mainfrom
bump-proto-jul24
Jul 27, 2026
Merged

Bump protosearch to latest snapshot#672
valencik merged 3 commits into
mainfrom
bump-proto-jul24

Conversation

@valencik

@valencik valencik commented Jul 24, 2026

Copy link
Copy Markdown
Member

Bump protosearch to latest snapshot which leverages a single configuration point so we can reuse the same config for the binary renderers and the preview server.

@valencik valencik self-assigned this Jul 24, 2026
@reardonj

Copy link
Copy Markdown
Contributor

I'm trying this out locally. I have observed that if I search in a subdirectory (eg. http://localhost:8000/community/) the search result links are relative to that directory. eg. if I search for "foundation", I get a link to: http://localhost:8000/community/foundation/index.html, instead of http://localhost:8000/foundation/index.html. The live site behaves correctly.

@reardonj

Copy link
Copy Markdown
Contributor

I was able to fix this locally by modifying

<a class="bulma-subtitle bulma-has-text-link" href="${link}">${title}</a>
to prefix the href with a slash

-        <a class="bulma-subtitle bulma-has-text-link" href="${link}">${title}</a>
+        <a class="bulma-subtitle bulma-has-text-link" href="/${link}">${title}</a>

@valencik

Copy link
Copy Markdown
Member Author

Ahh yes, the path field now omits the top level slash.
I pulled in the same fix from another PR here that included these changes
https://github.com/typelevel/typelevel.github.com/pull/637/changes#r3090174184

Comment thread src/main.js

function renderHit(hit) {
const link = `${hit.fields.path}.html`
const link = `/${hit.fields.path}.html`

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indexed path field now omits the top level slash.

Comment thread build.scala
import pink.cozydev.protosearch.laika.IndexConfig
import pink.cozydev.protosearch.ui.SearchUI

val indexConfig = IndexConfig.default

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea here is that we configure the protosearch-laika IndexConfig once and can then reuse it to get the Laika BinaryRendererConfig or IndexFormat depending on which we need.
Currently we're just using the default config, in the future we might configure other settings like which HOCON keys to add to the index as data.

@valencik
valencik marked this pull request as ready for review July 27, 2026 15:28
@valencik

Copy link
Copy Markdown
Member Author

I think we should bump up the number of search results from 10 (default) to like 50.
Previously there was no limit in place.
The search API supports pagination now, but there's nothing in place in our UI for it, and that's probably fine for now.

@valencik
valencik marked this pull request as draft July 27, 2026 16:37
@reardonj

Copy link
Copy Markdown
Contributor

50 sounds like plenty

@valencik valencik changed the title Bump protosearch to latest f6fbb35 snapshot Bump protosearch to latest snapshot Jul 27, 2026
@valencik
valencik marked this pull request as ready for review July 27, 2026 20:12
@valencik

Copy link
Copy Markdown
Member Author

Ready for review again.

The path issue is resolved, being on the community page and searching 'monad' should:

  • show only the top 50 results
  • links correctly go to blog posts

Additionally folks should be able to build the site locally again even with a clean cache.

Hopefully the last snapshot bump before a 0.0.1 release

@valencik
valencik merged commit 5b9cb6c into main Jul 27, 2026
1 check passed
@valencik
valencik deleted the bump-proto-jul24 branch July 27, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants